<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">{$title}</div>
                </div>
                <div class="widget-body am-fr">
                     <!-- 工具栏 -->
                    <div class="page_toolbar am-margin-bottom-xs am-fr">
                        <form class="toolbar-form">
                            <div class="am-u-sm-12">
                                <div class="am-fr">
                                    <div class="am-form-group am-fl">
                                        <div class="am-input-group am-input-group-sm tpl-form-border-form">
                                            <input type="text" class="am-form-field" name="search"
                                                   placeholder="请输入联系人、电话" value="{$search}">
                                            <div class="am-input-group-btn">
                                                <button class="am-btn am-btn-default am-icon-search" type="submit"></button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-hover tpl-table-black">
                            <thead>
                            <tr>
                                <th>编号ID</th>
								<th>联系人</th>
                                <th>联系电话</th>
                                <th>人数</th>
                                <th>备注</th>
                                <th>约定时间</th>
                                <th>状态</th>
                                <th>时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {if !$list->isEmpty()}
                                {foreach $list as $item}
                                <tr>
                                    <td class="am-text-middle">{$item['pact_id']}</td>
                                    <td class="am-text-middle"><P>{$item['linkman']}</P></td>
                                    <td class="am-text-middle">{$item['phone']}</td>
                                    <td class="am-text-middle">{$item['people']}</td>
                                    <td class="am-text-middle">{$item['message']}</td>
                                    <td class="am-text-middle">{$item['pact_time']['text']}</td>
									<td class="am-text-middle">
                                            <span class="am-badge  
                                            {$item['status']['value']==10?' am-badge-warning':''}
                                            {$item['status']['value']==20?' am-badge-danger':''}
                                            {$item['status']['value']==30?' am-badge-success':''}
                                            {$item['status']['value']==50?' am-badge-success':''}" >
                                            {$item['status']['text']}
                                            </span>
                                    </td>
                                    <td class="am-text-middle">{$item['create_time']}</td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="javascript:;" class="hema-status"
                                               data-id="{$item['pact_id']}" 
                                               data-status="{$item['status']['value']}" >
                                                <i class="am-icon-pencil"></i> 操作
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}
                            {else /}
                                <tr>
                                    <td colspan="9" class="am-text-center">暂无记录</td>
                                </tr>
                            {/if}
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr">{:$list->render()} </div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：{:$list->total()}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="order/pact/status" /}
<script>
    $(function () {
        $('.hema-status').on('click', function () {
            var data = $(this).data();
            $.showAction({
                title: '操作', 
                area: '750px', 
                content: template('tpl-status', {status:data.status}), 
                uCheck: true, 
                success: function ($content) {
                    $('#my-form').formPost({
                        url: "{:url('order.pact/status')}?id=" + data.id
                    });
                }, 
                btn2: function ($content) {
                    return true;
                }
            });
        });
    });
</script>